﻿Imports System.Data      'Importo lo necesario para trabajar con ODBC 
Imports System.Data.Odbc '
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports Entidades
Public Class DBHorarios
    Public cn As OdbcConnection
    Public con As SqlConnection
    Function agregahorario(nodo As Entidades.Horarios) As Boolean

        'Try
        '    Dim cmd As OdbcCommand = New OdbcCommand("{call agregahorarios (?,?,?)}", cn)
        '    cmd.CommandType = CommandType.StoredProcedure
        '    cmd.Parameters.AddWithValue("@horai", nodo.phoraini)
        '    cmd.Parameters.AddWithValue("@horaf", nodo.phorafin)
        '    cmd.Parameters.AddWithValue("@h", nodo.phora)

        '    cn.Open()
        '    cmd.ExecuteNonQuery()


        'Catch o As OdbcException
        '    MsgBox(o.Message.ToString)
        '    Return False
        'Finally
        '    cn.Close()

        'End Try
        Return True

    End Function
    Function modificahorario(nodo As Horarios) As Boolean
        Return True

    End Function
    Function eliminahorario(nodo As Entidades.Horarios) As Boolean
        Return True

    End Function
    Function consultahorarios() As DataSet

        Dim conn As SqlConnection = Nothing

        Dim ds As New DataSet

        Dim rdr As SqlDataReader = Nothing


        Try
            'Dim cmd As SqlCommand = New SqlCommand("{call consultahorarios ()}", cn)
            'cmd.CommandType = CommandType.StoredProcedure


            'Dim dap As New SqlDataAdapter
            'dap.SelectCommand = cmd
            'dap.Fill(ds)


            Return ds


        Catch ex As Exception
            MsgBox(ex.ToString)
            Return ds

        End Try
    End Function
End Class
